package cn.hd.service;

import cn.hd.entity.ProductLevel;
import cn.hd.entity.Productdetail;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ProductdetailService {
    //查询所有
    public PageInfo<Productdetail> selectProductdetail(int pageNum,int PageSize,Map map);
    //查询众筹完成
    public PageInfo<Productdetail> selectProductdetailSuccess(int pageNum,int pageSize);
    //查询众筹中
    public PageInfo<Productdetail> selectProductdetailIng(int pageNum,int pageSize);
    //查询众筹失败
    public PageInfo<Productdetail> selectProductdetailFailed(int pageNum,int pageSize);
    //查询众筹钱最多
    public PageInfo<Productdetail> selectByMoney(int pageNum,int pageSize,int state);
    //查询众筹人数最多
    public PageInfo<Productdetail> selectByPerson(int pageNum,int pageSize,int state);
    //最近发布
    public PageInfo<Productdetail> selectDateNow(int pageNum,int pageSize,int state);
    //根据pid查项目
    public Productdetail selectByPid(long pid);
    //根据id查询
    public Productdetail selectProductDetailById(long id);
    //根据状态查询
    public PageInfo<Productdetail> selectProductdetailByState(int pageNum,int pageSize,Map map);
    //审核通过
    public int updateStatuSuccess(long pid);
    //审核不通过
    public int updateStatuFailed(long pid);
    //根据一级name查询二级分类
    public List<ProductLevel> selectProductOneBytwo(String name);
    //添加关注
    public int addguanzhu(@Param("uid") long uid,@Param("pid")long pid);
    //往项目信息中添加发起人信息
    public String selectUserNamePro(long pid);
    //查询审核不通过的
    public PageInfo<Productdetail> selectByProShenhe(int pageNum,int pageSize,long uid);
    //修改状态值为0
    public int updateProState(long pid);
    //逻辑删除项目
    public int delProStatus(long pid);
    //删除中间表
    public int deluserPocduct(long pid);




    //zjc--开始
    public PageInfo<Productdetail> selectFQPro(int pagenum,int pagesize,int uid,int state);
    public PageInfo<Productdetail> selectProByUid(int pagenum,int pagesize,int uid);
    public int quxiaoguanzhu(int uid, int pid);
    public int addProduct(Productdetail productdetail);
    public int addFQpro(long uid, long productid);
    public List<Integer> selectFLzbaa();
    //查分类名称
    public List<String> selectFLmc();
    //通过pid查出详细的信息
    public Productdetail selectByp(long pid);
    //删除项目详情
    public int deleteProxqbyPid(long pid);
    //删除用户与项目详情中间表
    public int deleteProUserbyPid(long uid,long pid);
    //查询一级分类对象
    public List<ProductLevel> selectYJ();
    //通过项目名称查项目详情
    public Productdetail selectAllByXiamgMuname(String xnname);

    //    通过名字修改其价格
    public int updatselectPricenumBypnaem( String pname, double price);
    //支持人数加1
    public int updateZCjia1(String pname);

}
